package com.likai.app;

import com.likai.service.IDemoProviderService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

public class App {
    public static void main(String [] args) throws Exception {

        //加载classpath下的配置文件
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext(new String[]{"dubbo-demo-consumer.xml"});

        context.start();

        //获取bean的实例
        IDemoProviderService demoProviderService = (IDemoProviderService) context.getBean("demoProviderService");

        String result = demoProviderService.sayHello("李凯");

        System.out.println(result);

        //输入任意键退出
        System.in.read();

        context.close();
    }
}
